import request from '@/utils/request'
import defaultSettings from '@/settings'

// 用户选择查询
export const userSelectUrlConfig = {
  queryUrl: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/searchUser`,
}

// 消息分组维护列表查询
export const msgGroupMaintainUrlConfig = {
  queryUrl: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/search`,
}

// 生成消息分组ID返回前台
export function genMsgGroupId(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/genMsgGroupId`,
    method: 'get',
    params: data,
  })
}

// 消息分组关联用户查询
export const searchGroupUserUrlConfig = {
  queryUrl: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/searchGroupUser`,
}

// 消息分组审核列表查询
export const msgGroupApproveUrlConfig = {
  queryUrl: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupApprove/search`,
}

// // 消息分组审核详情关联用户查询
// export const approveGroupUserUrlConfig = {
//   queryUrl: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupApprove/searchGroupUser`,
// }

// 消息分组维护修改详情
export function msgGroupDetail(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/detail`,
    method: 'get',
    params: data,
  })
}

// 消息分组维护新增提交
export function msgGroupAdd(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/save`,
    method: 'post',
    data,
  })
}

// 消息分组维护修改提交
export function msgGroupUpdate(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/updateSave`,
    method: 'post',
    data,
  })
}

// 消息分组维护删除
export function msgGroupDelete(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/delete`,
    method: 'post',
    data,
  })
}

// 确认消息分组用户选择
export function confirmUserSelect(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/confirmUserSelect`,
    method: 'post',
    data,
  })
}

// 删除消息分组用户信息
export function groupUserDelete(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/groupUserDelete`,
    method: 'post',
    data,
  })
}

// 取消删除消息分组用户信息
export function groupUserCancel(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupMaintain/groupUserCancel`,
    method: 'post',
    data,
  })
}

// 消息分组审核详情
export function msgGroupApproveDetail(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupApprove/detail`,
    method: 'get',
    params: data,
  })
}

// 消息分组审批通过
export function msgGroupApprove(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupApprove/approve`,
    method: 'post',
    data,
  })
}

// 消息分组审批拒绝
export function msgGroupReject(data) {
  return request({
    url: `${defaultSettings.ctx.cnapsApp}/transactionManage/msgManageControl/MsgGroupApprove/reject`,
    method: 'post',
    data,
  })
}